<?php

namespace app\admin\validate;

use think\Validate;

class Exam extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'A' => 'require',
        'B' => 'require',
        'C' => 'require',
        'D' => 'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'A.require' => '选项A必须',
        'B.require' => '选项B必须',
        'C.require' => '选项C必须',
        'D.require' => '选项D必须',
    ];

     /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['A', 'B', 'C', 'D'],
        'edit' => ['A', 'B', 'C', 'D'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'A' => __('A'),
            'B' => __('B'),
            'C' => __('C'),
            'D' => __('D'),
        ];

        parent::__construct($rules, $message, $field);
    }
}
